* White Americans' Evaluations of the Alt-Right
* Kevin K. Banda and John Cluverius
* Replication file

use "VOTER_Survey_July17_Release1-dta.dta", clear

recode pid7_2017 1/3 = 1 4 = 2 5/7 = 3 . 8 = ., gen(pid317)
label define pid3lab 1 "Democrat" 2 "Independent" 3 "Republican"
label values pid317 pid3lab
recode pid7_2016 1/3 = 1 4 = 2 5/7 = 3 . 8 = ., gen(pid316)
label values pid316 pid3lab

* Did respondents complete 2016 and 2017 waves?
gen both = 0
replace both = 1 if weight_2016!=. & weight_2017!=.

* Keep only respondents who completed the 2016 and 2017 waves
keep if both==1


* Alt-right feeling thermometer
rename ft_altright_2017 artherm17
replace artherm17 = . if artherm17==997
rename ft_altright_2016 artherm16
replace artherm16 = . if artherm16==997
gen ardiff = artherm17 - artherm16


* Trump favorability in 2016
recode fav_trump_2016 (4 = 0 "Very unfavorable") (3 = 1 "Somewhat unfavorable") ///
	(2 = 2 "Somewhat favorable") (1 = 3 "Very favorable") (. 8 = .) , gen(trumpfav2016)
	
* Trump favorability in 2017
recode fav_trump_2017 (4 = 0 "Very unfavorable") (3 = 1 "Somewhat unfavorable") ///
	(2 = 2 "Somewhat favorable") (1 = 3 "Very favorable") (. 8 = .) , gen(trumpfav2017)

* Sex
gen woman = gender_baseline-1

* Ideological ID
recode ideo5_2016 1 2 = 1 3 = 2 4 5 = 3 6 . = ., gen(ideo316)
label define ideo3lab 1 "Liberal" 2 "Moderate" 3 "Conservative"
label values ideo316 ideo3lab

* Self-placed ideology
replace ideo5_2016 = . if ideo5_2016==6
rename ideo5_2016 conservatism16

* Race
recode race_2016 1 = 1 2 = 2 3 = 3 4 = 4 5/8 = 5 . = ., gen(race5)
label define race5lab 1 "White" 2 "Black" 3 "Hispanic" 4 "Asian" 5 "Other"
label values race5 race5lab
recode race5 1 = 1 2/5 = 0 . = ., gen(white)
label define whitelab 0 "Non-white" 1 "White"
label values white whitelab
recode race5 (1 = 1 "White") (2 = 2 "Black") (3 = 3 "Hispanic") (4 5 = 4 "Other") ///
	(. = .), gen(race4)

* Racial resentment
* 2016
replace race_deservemore_2016 = . if race_deservemore_2016==8
replace race_overcome_2016 = . if race_overcome_2016==8
replace race_tryharder_2016 = . if race_tryharder_2016==8
replace race_slave_2016 = . if race_slave_2016==8
* Create 2016 racial resentment measure ranging from 0 to 1
gen resentment2016 = race_deservemore_2016 + ((-1 * race_overcome_2016) + 5) + ///
	((-1 * race_tryharder_2016) + 5) + race_slave_2016
replace resentment2016 = (resentment2016-4) / 12
alpha race_deservemore_2016 race_overcome_2016 race_tryharder_2016 race_slave_2016, item // alpha = .9196
factor race_deservemore_2016 race_overcome_2016 race_tryharder_2016 race_slave_2016, pcf // One dimension

* Sexism denialism (sexism1_...)
gen sexismfull16 = ((-1 * sexism1_2016) + 5) + ((-1 * sexism2_2016) + 5) + sexism3_2016 ///
	+ ((-1 * sexism4_2016) + 5) + ((-1 * sexism5_2016) + 5) + sexism6_2016
replace sexismfull16 = (sexismfull16 - 6) / 18
alpha sexism1_2016 sexism2_2016 sexism3_2016 sexism4_2016 sexism5_2016 sexism6_2016, item // alpha = .8145
factor sexism1_2016 sexism2_2016 sexism3_2016 sexism4_2016 sexism5_2016 sexism6_2016, pcf // One dimension

gen hostilesexism = ((-1 * sexism2_2016) + 5)
gen hostilesexism2 = ((-1 * sexism2_2016) + 5) + ((-1 * sexism4_2016) + 5)
replace hostilesexism2 = (hostilesexism2 - 2) / 6

* Age
gen age17 = 2017-birthyr_baseline
gen age16 = 2016-birthyr_baseline

* Interest
recode newsint_2016 4 = 1 3 = 2 2 = 3 1 = 4 7 . = ., gen(interest16)

* Strength of national economy
recode econtrend_2016 (1 = 3 "Getting better") (2 = 2 "About the same") ///
	(3 = 1 "Getting worse") (4 . = .), gen(economy16)

* Income
rename faminc_2016 income16
replace income16 = 12 if income16==31
replace income16 = . if income16==97

* Reverse discrimination
replace reverse_discrimination_2016 = . if reverse_discrimination_2016==8
recode reverse_discrimination_2016 (1 = 4 "Strongly agree") (2 = 3 "Agree") ///
	(3 = 2 "Disagree") (4 = 1 "Strongly disagree") (. = .), gen(reverse16)

	
	
* Histograms for white Americans	

twoway histogram artherm16 if race4==1, percent xsize(4) ysize(4) ///
	xlabel(0(20)100, labsize(medlarge) nogrid) xtitle("", size(medium)) ///
	yline(45, lc(white) lp(solid)) ytitle("", size(medium)) ///
	ylabel(0(5)45, labsize(medlarge)) title("") subtitle(, size(medium)) title("2016 Evaluations of the Alt-Right", size(medlarge)) ///
	xtitle("", size(medlarge)) name(g5, replace)

twoway histogram artherm17 if race4==1, percent xsize(4) ysize(4) ///
	xlabel(0(20)100, labsize(medlarge) nogrid) xtitle("", size(medium)) ///
	yline(45, lc(white) lp(solid)) ytitle("", size(medium)) ///
	ylabel(0(5)45, labsize(medlarge)) title("") subtitle(, size(medium)) title("2017 Evaluations of the Alt-Right", size(medlarge)) ///
	xtitle("", size(medlarge)) name(g1, replace)
	
twoway histogram resentment2016 if race4==1, percent discrete xsize(4) ysize(4) ///
	xlabel(, labsize(medlarge) nogrid) xtitle("", size(medium)) ///
	yline(45, lc(white) lp(solid)) ytitle("", size(medium)) ///
	ylabel(0(5)45, labsize(medlarge)) title("") subtitle(, size(medium)) title("Racial resentment", size(medlarge)) ///
	xtitle("", size(medlarge)) name(g2, replace)
	
twoway histogram hostilesexism if race4==1, percent discrete xsize(4) ysize(4) ///
	xlabel(, labsize(medlarge) nogrid) xtitle("", size(medium)) ///
	yline(45, lc(white) lp(solid)) ytitle("", size(medium)) ///
	ylabel(0(5)45, labsize(medlarge)) title("") subtitle(, size(medium)) title("Hostile sexism", size(medlarge)) ///
	xtitle("", size(medlarge)) name(g3, replace)

twoway histogram reverse16 if race4==1, percent discrete xsize(4) ysize(4) ///
	xlabel(, labsize(medlarge) nogrid) xtitle("", size(medium)) ///
	yline(45, lc(white) lp(solid)) ytitle("", size(medium)) ///
	ylabel(0(5)45, labsize(medlarge)) title("") subtitle(, size(medium)) title("Discrimination against whites", size(medlarge)) ///
	xtitle("", size(medlarge)) name(g4, replace)

twoway histogram conservatism16 if race4==1, percent discrete xsize(4) ysize(4) ///
	xlabel(, labsize(medlarge) nogrid) xtitle("", size(medium)) ///
	yline(45, lc(white) lp(solid)) ytitle("", size(medium)) ///
	ylabel(0(5)45, labsize(medlarge)) title("") subtitle(, size(medium)) title("Ideological conservatism", size(medlarge)) ///
	xtitle("", size(medlarge)) name(g6, replace)

twoway histogram trumpfav2016 if race4==1, percent discrete xsize(4) ysize(4) ///
	xlabel(, labsize(medlarge) nogrid) xtitle("", size(medium)) ///
	yline(45, lc(white) lp(solid)) ytitle("", size(medium)) ///
	ylabel(0(5)45, labsize(medlarge)) title("") subtitle(, size(medium)) title("Trump favoritism", size(medlarge)) ///
	xtitle("", size(medlarge)) name(g7, replace)
	
graph combine g5 g1 g2 g3 g4 g6 g7, l1("Percentage of observations") b1("Lowest to highest") ///
	row(2) xsize(8) ysize(4)
*graph export "histograms.pdf", as(pdf) replace


* Greatest source of missingness is the AR thermometer (just under 22% missing), then the RR measure.
codebook artherm16 artherm17 resentment2016 hostilesexism reverse16 conservatism16 trumpfav2016 ///
	pid316 woman educ_2016 economy16 interest16 age16 income16 if race4==1
	
* Summary statistics
sum artherm16 artherm17 resentment2016 hostilesexism reverse16 conservatism16 trumpfav2016 ///
	i.pid316 i.woman educ_2016 economy16 interest16 age16 income16 if race4==1

* 2016 outcome and predictors
reg artherm16 resentment2016 hostilesexism reverse16 conservatism16 trumpfav2016 i.pid316 ///
	woman educ_2016 economy16 interest16 age16 income16 [pw=weight_2016] if race4==1
estimates store m1

* 2017 outcome, 2016 predictors
reg artherm17 resentment2016 hostilesexism reverse16 conservatism16 trumpfav2016 i.pid316 ///
	woman educ_2016 economy16 interest16 age16 income16 [pw=weight_2017] if race4==1
estimates store m2

estout m1 m2, cells(b(star fmt(2)) se(par fmt(2))) unstack  starlevels(* 0.1 ** 0.05) stats(r2_a N) ///
		legend label style(tex)	
	
* Lagged DV
reg artherm17 artherm16 resentment2016 hostilesexism reverse16 conservatism16 trumpfav2016 ///
	[pw=weight_2017] if race4==1
estimates store m3

estout m3, cells(b(star fmt(2)) se(par fmt(2))) unstack  starlevels(* 0.1 ** 0.05) stats(r2_a N) ///
		legend label style(tex)